<template>
  <span>
    <el-input v-model="selectValue" disabled />
  </span>
</template>

<script setup>
import {onMounted, ref, watch} from 'vue';
import api from '@/http/api';

const props = defineProps({
  modelValue: String
});

const selectValue = ref();

const loadEmployee = (ids) => {
  if ((ids || '') === '') {
    return;
  }

  api.post('/employee/queryByIds', {ids: ids.split(',')}).then(res => {
    selectValue.value = res.data || '';
  });
};

watch(() => props.modelValue, (ids) => {
  loadEmployee(ids);
});

onMounted(() => {
  loadEmployee(props.modelValue);
});
</script>

<style scoped>
</style>
